package com.kt.mes.service;

import com.kt.mes.domain.FromMes;
import com.kt.mes.domain.OpcNode;
import com.kt.mes.domain.ToMes;
import org.eclipse.milo.opcua.sdk.client.OpcUaClient;
import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;

import java.util.List;
import java.util.Map;

public interface IOpcService {


    //根据 工位 和 托盘号 找工作计划
    FromMes findWorkPlanByTray(String siteId, int trayId,boolean last);

    public FromMes findWorkPlan(String siteId);

    public FromMes findWorkPlanAndTb(String siteId);
    public void productStoreIn(String oId);
    public void updateWpAndWpiAndOp(ToMes toMes);
    public void finWpAndWpiAndOp(ToMes toMes);
    public void finWpAndWpiAndRk(ToMes toMes);
    public void finAndUnWpAndWpiAndOp(ToMes toMes);//不合格完成
    public void writeOpc(OpcUaClient opc,FromMes fromMes, OpcNode opcNode);
    public void writeOpc(OpcUaClient opc,FromMes fromMes, NodeId node_fun_site_FROMMES, NodeId node_oid_FROMMES, NodeId node_oposid_FROMMES, NodeId node_opid_FROMMES, NodeId node_step_num_FROMMES, NodeId node_param01_FROMMES, NodeId node_param02_FROMMES);

    public ToMes readOpc(OpcUaClient opc, OpcNode opcNode);
    public ToMes readOpc(OpcUaClient opc, NodeId node_oid_TOMES, NodeId node_oposid_TOMES, NodeId node_opid_TOMES, NodeId node_step_num_TOMES,NodeId node_tray_id);
    public void resetOpc(OpcUaClient opc,OpcNode opcNode );
    public void resetOpc(OpcUaClient opc,NodeId node_fun_TOMES, NodeId node_oid_TOMES, NodeId node_oposid_TOMES, NodeId node_opid_TOMES, NodeId node_step_num_TOMES,NodeId node_tray_id);


    public  void printLight(String content,String codeStr);


    public FromMes findParam(ToMes toMes);


    public boolean  addFileToUpan(String url,String fileName);


    List<Map<String,Object>> opcNodeToMap(OpcNode opcNode, FromMes fromMes);

    List<Map<String,Object>> opcNodeToMap(OpcNode opcNode, ToMes toMes);
}
